import React from "react";

/**
 * 加载图片或样式文件
 * */
import './sass/Price.scss';


export default class Price extends React.Component {
    static propTypes = {
        isScore: React.PropTypes.bool,  // 是否为积分
        size: React.PropTypes.string,  // 是否为积分
        num: React.PropTypes.number.isRequired
    };

    constructor(props) {
        super(props);
        this.state = {}
    }

    render() {
        const {isScore, num, size} = this.props;
        return (
            <span className={"price-wrap " + (size ==='sm' ? 'sm' :'')}>
                {
                    isScore ? null : <i>¥</i>
                }
                {
                    isScore ? <span className="price">{num}</span> : <span className="price">{num / 100}</span>
                }
                {
                    isScore ? <i>积分</i> : <i>元</i>
                }

            </span>
        )
    }
}